#include "Processbar.h"
#include <unistd.h>
//dowanload
void download(double filesize,callback_t cb)
{
  //double filesize =100*1024*1024*1.0;
  double current =0.0;
  double bandwidth=1024*1024*1.0;
  
  printf("download begin,current:%lf\n",current);
  while(current<=filesize)
  {
    cb(filesize,current);
    current+=bandwidth;
    usleep(10000);
  }
  printf("\ndownload done,filesize:%lf\n",filesize);

}

int main()
{
 // Fortest();
  download(100*1024*1024,ProBar); 
  download(10*1024*1024,ProBar);
  download(50*1024*1024,ProBar);
  download(20*1024*1024,ProBar);
  download(30*1024*1024,ProBar);
 // ProBar(100.0,56.9);
 // ProBar(100.0,66.9);
 // ProBar(100.0,86.9);
  return 0;
}
